package com.ruoyi.hospital.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.InspectionMapper;
import com.ruoyi.hospital.domain.Inspection;
import com.ruoyi.hospital.service.IInspectionService;

/**
 * 检查项目信息Service业务层处理
 * 
 * @author qichi
 * @date 2023-07-05
 */
@Service
public class InspectionServiceImpl implements IInspectionService 
{
    @Autowired
    private InspectionMapper inspectionMapper;

    /**
     * 查询检查项目信息
     * 
     * @param id 检查项目信息主键
     * @return 检查项目信息
     */
    @Override
    public Inspection selectInspectionById(Long id)
    {
        return inspectionMapper.selectInspectionById(id);
    }

    /**
     * 查询检查项目信息列表
     * 
     * @param inspection 检查项目信息
     * @return 检查项目信息
     */
    @Override
    public List<Inspection> selectInspectionList(Inspection inspection)
    {
        return inspectionMapper.selectInspectionList(inspection);
    }

    /**
     * 新增检查项目信息
     * 
     * @param inspection 检查项目信息
     * @return 结果
     */
    @Override
    public int insertInspection(Inspection inspection)
    {
        inspection.setCreateTime(DateUtils.getNowDate());
        return inspectionMapper.insertInspection(inspection);
    }

    /**
     * 修改检查项目信息
     * 
     * @param inspection 检查项目信息
     * @return 结果
     */
    @Override
    public int updateInspection(Inspection inspection)
    {
        inspection.setUpdateTime(DateUtils.getNowDate());
        return inspectionMapper.updateInspection(inspection);
    }

    /**
     * 批量删除检查项目信息
     * 
     * @param ids 需要删除的检查项目信息主键
     * @return 结果
     */
    @Override
    public int deleteInspectionByIds(Long[] ids)
    {
        return inspectionMapper.deleteInspectionByIds(ids);
    }

    /**
     * 删除检查项目信息信息
     * 
     * @param id 检查项目信息主键
     * @return 结果
     */
    @Override
    public int deleteInspectionById(Long id)
    {
        return inspectionMapper.deleteInspectionById(id);
    }
}
